package webgamemaker.FightCanvas;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DecoratorPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.VerticalPanel;

public class FightBottomBar extends HorizontalPanel 
{
	public FightWindow fightWindow;
	public FightBottomBar(FightWindow fightWindow)
	{
		this.fightWindow = fightWindow;
		VerticalPanel verticalPanel = new VerticalPanel();
		HTML attackButton = new HTML("<div>attaque</div>");
		attackButton.addClickHandler(new ClickHandler()
			{
				public void onClick(ClickEvent event) 
				{
					Fighter fighter = FightBottomBar.this.fightWindow.fightCanvas.fighterSelected;
					if(fighter != null)
					{
						Team team[] = FightBottomBar.this.fightWindow.fightCanvas.listTeam;
						FighterActionListe actionListe = new FighterActionListe();
						actionListe.addAction(new FighterActionMove(team[1].listFighter.get(0).x-200, team[1].listFighter.get(0).y,20,10));
						actionListe.addAction(new FighterActionJump(team[1].listFighter.get(0).x-200,team[1].listFighter.get(0).y,100,15,10));
						actionListe.addAction(new FighterActionJump(team[1].listFighter.get(0).x-100,team[1].listFighter.get(0).y,-100,15,10));
						actionListe.addAction(new FighterActionMove(fighter.x, fighter.y,20,10));
						fighter.currentAction = actionListe;
					}
				}
				
			});
		verticalPanel.add(attackButton);
		HTML techniqueButton = new HTML("<div>technique</div>");
		verticalPanel.add(techniqueButton);
		HTML inventaireButton = new HTML("<div>inventaire</div>");
		verticalPanel.add(inventaireButton);
		add(verticalPanel);
	}
}
